import "../../../css/Header.css";
import urlHook from "pages/ruijing/common/utils/urlHook";
import CookieUtils from "pages/ruijing/common/utils/CookieUtils";

function LoginInfo(props) {
    const {orgnization,username} = props;

    React.useEffect(() => {
        Uts.changeHeader();
    }, []);

    return (
        <div className="zen_m-l-p60 zen_h-50 zen_FFFFFF zen_m-r-100 zen_l-h-25">
            <p className="zen_fs-12">
                <span>{username}</span>
                <span className="zen_m-l-10 zen_cur-p hmsHeader-logOut" onClick={(e) =>{logout(e)}}>退出登录</span>
            </p>
            <p className="zen_fs-12">
                {orgnization}
            </p>
        </div>
    );
}

function logout(e) {
    CookieUtils.clearAllCookiesAndStorage();
    Uts.routeToDomain('hms','')
}

export default LoginInfo;